package com.esender.common.enums;

import lombok.Getter;

@Getter
public enum MobileOperatorEnum {

    CHINA_MOBILE(1,"移动"),
    CHINA_UNICOM(2,"联通"),
    CHINA_TELECOM(3,"电信"),
    UNKNOWN(0,"未知")
    ;

    private Integer operatorId;
    private String operatorName;

    MobileOperatorEnum(Integer operatorId, String operatorName) {
        this.operatorId = operatorId;
        this.operatorName = operatorName;
    }

    public static  MobileOperatorEnum getMobileOperator(String name){
        for (MobileOperatorEnum mobileOperatorEnum : MobileOperatorEnum.values()) {
            if(mobileOperatorEnum.getOperatorName().equals(name)){
                return mobileOperatorEnum;
            }
        }
        return null;
    }
}
